package com.spring.common.util;

import java.io.PrintWriter;
import java.io.StringWriter;
/**
 * 
 * @author sunchengtao
 * @purpose Exception common method
 */
public class ExceptionUtil {
	/**
	 * 获取异常的堆栈信息
	 * @param t
	 * @return
	 */
	public static String getStackTrace(Throwable t){
		StringWriter swriter = new StringWriter();
		PrintWriter pwriter = new PrintWriter(swriter);
		
		t.printStackTrace(pwriter);
		return swriter.toString();
	}
}
